home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 001-010 / amok02 / iffload / showiff.mod < prev    next >
Text File  |  1993-11-04  |  2KB  |  59 lines

  1. (*---------------------------------------------------------------------------
  2.     :Program.    ShowIFF.mod
  3.     :Author.     Fridtjof Siebert
  4.     :Address.    Nobileweg 67, D-7-Stgt-40
  5.     :Phone.      0711/822509
  6.     :Shortcut.   [fbs]
  7.     :Version.    1.0
  8.     :Date.       20.04.88
  9.     :Copyright.  PD
  10.     :Language.   Modula-II
  11.     :Translator. M2Amiga
  12.     :Imports.    IFFLoad [fbs].
  13.     :UpDate.     none.
  14.     :Contents.   IFF-Ladeprogramm zum Betrachten von IFF (ILBM)-Bildern.
  15.     :Remark.     Syntax: ShowIFF <filename>
  16. ---------------------------------------------------------------------------*)
  17. MODULE ShowIFF;
  18.  
  19. FROM SYSTEM IMPORT ADR, ADDRESS, SHIFT, BITSET, LONGSET, CAST;
  20.  
  21. FROM Arguments IMPORT NumArgs,GetArg;
  22.  
  23. FROM Intuition IMPORT ScreenPtr,CloseScreen,DisplayBeep,WindowPtr;
  24.  
  25. FROM IFFLoad IMPORT ReadILBM,ReadILBMFlags,ReadILBMFlagSet;
  26.  
  27. VAR
  28.   MyScreen: ScreenPtr;        (* the Picture's ScreenPointer               *)
  29.   WindowDummy: WindowPtr;     (* only a dummy for NIL-Windowpointer        *)
  30.   Name: ARRAY[0..79] OF CHAR; (* the Picture's Name                        *)
  31.   length: INTEGER;            (* dummy for receiving Name's Length         *)
  32.   Ciapra [0BFE001H]: SET OF (s0,s1,s2,s3,s4,s5,lmb);
  33.     (* Ciapra is a Hardware-Register. Bit #6 contains the left Button      *)
  34.  
  35. BEGIN
  36.  
  37. (*------  Get Name:  ------*)
  38.  
  39.   IF NumArgs()#0 THEN
  40.     GetArg(1,Name,length);
  41.   ELSE
  42.     HALT; (* a silly guy didn't say which pic I should load *)
  43.   END;
  44.  
  45. (*------  Read and Show Pic:  ------*)
  46.  
  47.   IF ReadILBM(Name,ReadILBMFlagSet{front,visible},MyScreen,WindowDummy) THEN
  48.  
  49.     WHILE lmb IN Ciapra DO END;
  50.     (* that's bad style, but it's the easiest way to wait for left Button  *)
  51.  
  52.     CloseScreen(MyScreen); (* close the Screen *)
  53.  
  54.   ELSE
  55.     DisplayBeep(NIL); (* any error occured: lets display a Beep ! *)
  56.   END;
  57.  
  58. END ShowIFF. That's all. Wasn't that easy ???
  59.